/*
 * @Date: 2022-08-25 14:13:11
 * @LastEditors: 黑瞎子岛 495727881@qq.com
 * @LastEditTime: 2023-05-24 15:00:32
 * @FilePath: /Workflow-Vue3/src/store/index.js
 */
/**
 * @Date: 2022-08-25 14:13:11
 * TODO: 流程图绘制数据对象
 * 云崖静海
 */
/*
 * pinia 是一个 Vue.js 3 的状态管理库;
 * 它通过 Vue 的组合式函数和 API 让您在 Vue 组件中拥有基于响应式状态的单独数据存储。
 */
import { defineStore } from 'pinia';

export const useStore = defineStore('store', {
	state: () => ({
		//发起人
		promoterDrawer: false,
		//发起人配置
		starterConfigData: {},

		//审核人
		approverDrawer: false,
		//审核人配置
		approverConfigData: {},

		//条件
		conditionDrawer: false,
		//条件配置
		conditionsConfig1: {
			conditionNodes: [],
		},

		//抄送人
		copyerDrawer: false,
		//抄送人配置
		copyerConfig1: {},

		//延时器	
		delayDrawer: false,
		//延时器配置
		delayConfigData: {},
	}),
	actions: {
		//发起人	
		setPromoter(payload) {
			this.promoterDrawer = payload
		},
		//发起人配置
		setStarterConfig(payload) {
			this.starterConfigData = payload
		},
		
		//审核人
		setApprover(payload) {
			this.approverDrawer = payload
		},
		//审核人配置
		setApproverConfig(payload) {
			this.approverConfigData = payload
		},

		//条件
		setCondition(payload) {
			this.conditionDrawer = payload
		},
		//条件配置
		setConditionsConfig(payload) {
			this.conditionsConfig1 = payload
		},

		//抄送人
		setCopyer(payload) {
			this.copyerDrawer = payload
		},
		//抄送人配置
		setCopyerConfig(payload) {
			this.copyerConfig1 = payload
		},

		//延时器
		setDelay(payload) {
			this.delayDrawer = payload
		},
		//延时器配置
		setDelayConfig(payload) {
			this.delayConfigData = payload
		},
	}
})
